# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-gitdb2
pkgver=4.0.11
pkgrel=1
pkgdesc="Git Object Database"
url="https://github.com/gitpython-developers/gitdb"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-smmap2"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/gitpython-developers/gitdb/archive/$pkgver.tar.gz"
builddir="$srcdir/gitdb-$pkgver"

prepare() {
	default_prepare

	git init -q .
	git config --local user.name "example"
	git config --local user.email "example@example.com"
	git add .
	git commit -m "tests"
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest \
		-k 'not test_pack_writing'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b6802b017dbfb3b8c72d174a25bd180ff335c8560f7b4bc27884ad5f4d7bc106a43d11d57a838a2efdaae9723269bfc57b0ff68ca7fb94eb1ad3e2cbbf014a05  py3-gitdb2-4.0.11.tar.gz
"
